#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2018, Intel Corporation
#
#
# pmempool_info/TEST9 -- test for info command
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type pmem non-pmem

setup

POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create -w blk 512 $POOL
INFO_NFLOG=$(expect_normal_exit $PMEMPOOL$EXESUFFIX info $POOL | $GREP 'Free blocks' | $GREP -o '[0-9]\+')
NFLOG=$(expect_normal_exit $PMEMPOOL$EXESUFFIX info -g $POOL | $GREP -co '^[0-9]\+:')

[[ $INFO_NFLOG == $NFLOG ]] || fatal "$INFO_NFLOG $NFLOG"

check

pass
